Source of SendMail.jsp
<%@ page contentType="text/html;charset=WINDOWS-1252"%>
<%--
@author Srinivas
@version 1.1
Development Environment : Oracle9i JDeveloper
Name of the Application : SendMail.jsp
Creation/Modification History :
Srinivas 13-Sep-2000 Created
Srinivas 04-Jan-2002 Updated For OC4J2.0
Overview of Application :
This JSP is part of the Send Mail sample. This JSP
is called from another JSP 'MailInputs' with the
inputs for the mail. For example, input p_to refers
to the recipient's mail address.
These inputs are validated by the API and on successful
validation a Mail is send using the Java Mail API.
If the validation is not successful an appropriate
error message is returned.
--%>
<HTML>
<HEAD>
<TITLE>OC4J JSP Sample - Send Email</TITLE>
</HEAD>
<BODY background="../../images/Background.gif">
<CENTER>
<BR>
<%--
Prepare the inputs and call the bean method to send the
mail using the API
--%>
<jsp:useBean id="sendMail" class="SendMailBean" scope="page" />
<%
String l_from = request.getParameter("p_from");
String l_to = request.getParameter("p_to");
String l_cc = request.getParameter("p_cc");
String l_bcc = request.getParameter("p_bcc");
String l_subject = request.getParameter("p_subject");
String l_message = request.getParameter("p_message");
String l_smtpSvr = request.getParameter("p_smtpServer");
session.setAttribute("smtpServer",l_smtpSvr);
String l_result = sendMail.send(l_from,l_to,l_cc,l_bcc,l_subject,l_message,l_smtpSvr);
%>
<%= l_result %>
<FONT SIZE=3 COLOR="blue">
<A HREF="InputsForm.jsp">Compose Mail</A>
</CENTER>
</BODY>
</HTML>
</html